package com.config;

import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class CrossConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**");
        registry.addMapping("/**")
                .allowedHeaders("*")
                .allowedMethods("POST","GET","HEAD","PUT","OPTIONS","DELETE")
                .allowedOrigins("*")
                .allowCredentials(true)
                .maxAge(3600);
    }
}
